<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="col-md-12">
    <h3>Boeking overzicht</h3>
</div>
<c:if test="${not empty tripbookings}">
    <c:forEach var="booking" items="${tripbookings}">
        <div class="col-md-11 col-centered predefinedOverview">        
            <a href="${pageContext.request.contextPath}/trip/details/${booking.tripViewmodel.trip.id}"><h4>${booking.tripViewmodel.trip.title}</h4></a>
            <div class="col-md-6 ">
                <p>
                    <c:forEach var="accommodation" items="${booking.tripViewmodel.accommodations}">
                        ${accommodation.country.name} - ${accommodation.city.name} |
                    </c:forEach>
                <p>
                <p>Aantal personen: ${booking.tripbooking.totalPersons}</p>
                <p>Vertrekdatum: <fmt:formatDate value="${booking.tripbooking.startDate}" pattern="dd-MM-yyyy" /></p>
                <p>Terugkomt: <fmt:formatDate value="${booking.tripbooking.endDate}" pattern="dd-MM-yyyy" /></p>
                <p>Prijs: ${sign} <fmt:formatNumber pattern="#.00" value="${booking.tripbooking.price/10}"/></p>        
            </div>
            <div class="col-md-6">
                <p> Aanbetalingsbedrag: ${sign} <fmt:formatNumber pattern="#.00" value="${booking.tripbooking.price/100}"/></p>
                <p> Restant bedrag: ${sign} <fmt:formatNumber pattern="#.00" value="${booking.tripbooking.price/100*9}"/></p>
            </div>
        </div>
    </c:forEach>
</c:if>
